<?php

/**
 * Freetext form base class.
 *
 * @method Freetext getObject() Returns the current form's model object
 *
 * @package    briefingPropel
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseFreetextForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idFreeText' => new sfWidgetFormInputHidden(),
      'text'       => new sfWidgetFormInputText(),
      'url_image'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idFreeText' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdfreetext()), 'empty_value' => $this->getObject()->getIdfreetext(), 'required' => false)),
      'text'       => new sfValidatorString(array('max_length' => 500)),
      'url_image'  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('freetext[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Freetext';
  }


}
